package luke4fun.wheresmymoney.bean;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class AccBean {

	private String category;
	private String store;
	private long sum = 0L;
	private Map<Long, AccDtlBean> dtlMap = new LinkedHashMap<Long, AccDtlBean>();

	public AccBean() {
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getStore() {
		return store;
	}

	public void setStore(String store) {
		this.store = store;
	}

	public long getSum() {
		return sum;
	}

	public void setSum(long sum) {
		this.sum = sum;
	}

	public AccDtlBean getDtl(Long id) {
		return dtlMap.get(id);
	}
	
	public void putDtl(Long id, AccDtlBean dtl) {
		dtlMap.put(id, dtl);
	}
	
	public List<AccDtlBean> getDtlList() {
		List<AccDtlBean> list = new ArrayList<AccDtlBean>(0);
		list.addAll(dtlMap.values());
		
		return list;
	}
}
